package com.dengyuanke.controller;

import com.dengyuanke.common.result.JsonResult;
import com.dengyuanke.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/swagger")
@Api(description = "Swagger测试API")
public class SwaggerTestController {
    @ApiOperation(value = "一个测试API", notes = "这是一个nots")
    @PostMapping(value = "/swaggertest/{path}")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "User", value = "用户", required = true, paramType = "body", dataType = "User",example="dasdfa"),
            @ApiImplicitParam(name = "path", value = "url上的数据", required = true, paramType = "path", dataType = "Long",example = "1232"),
            @ApiImplicitParam(name = "query", value = "query类型参数", required = true, paramType = "query", dataType = "String"),
            @ApiImplicitParam(name = "apiKey", value = "header中的数据", required = true, paramType = "header", dataType = "String")
    })
    public JsonResult test(
                           @PathVariable Long path,
                           String query,
                           @RequestHeader String token){
       // System.err.println("user-->"+user);
        System.err.println("path-->"+path);
        System.err.println("query-->"+query);
        System.err.println("token-->"+token);
        return JsonResult.renderSuccess("aa");
    }
}
